import $axios from "@/plugins/request"
import { login, logout } from "@/store/actions/user"


export const loginAsync = (params) => {
  return async (dispatch) => {
    const { data } = await $axios.post("/api/users/login", params);
    dispatch(login(data.data))
    return data;
  }
}

export default {
  loginAsync
}